package com.action.memberInfo;
import com.db.memberInfo.*;
import com.opensymphony.xwork2.ActionContext;

public class MemberInfoAction {
	private int memno;
	private String pwd;
	private String tel1;
	private String tel2;
	private String email;
	private String picture;
	
	private MemberInfoVO vo = new MemberInfoVO();
	
	public void setEmail(String email) {
		this.email = email;
	}	
	
	public MemberInfoVO getVo() {
		return vo;
	}
	public void setVo(MemberInfoVO vo) {
		this.vo = vo;
	}
	public void setMemno(int memno) {
		this.memno = memno;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public void setTel1(String tel1) {
		this.tel1 = tel1;
	}
	public void setTel2(String tel2) {
		this.tel2 = tel2;
	}
	public void setPicture(String picture) {
		this.picture = picture;
	}
	
	public String getMemberInfo() throws Exception{
		System.out.println("========== MemberInfoAction =============");
memno = Integer.parseInt((String) ActionContext.getContext().getSession().get("memno"));//////////////////////////////////////////////////

		System.out.println(memno);
		vo = MemberInfoManager.getMemberInfo(memno);

		System.out.println(vo.getName());
		System.out.println(vo.getDname());
		return "success";
	}
	
	public String memberInfoUpdate() throws Exception{
		System.out.println("=============== memberInfoUpdate ==============");
memno = Integer.parseInt((String) ActionContext.getContext().getSession().get("memno"));//////////////////////////////////////////////////

		vo.setMemno(memno);
		vo.setPwd(pwd);
		vo.setTel1(tel1);
		vo.setTel2(tel2);
		vo.setEmail(email);
		vo.setPicture(picture);			
		MemberInfoManager.memberInfoUpdate(vo);
		
		return "success";
	}
}
